﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>下拉菜单，单选</title>
    <style>
        <!--
        form {
            padding: 0px;
            margin: 0px;
            font: 14px Arial;
        }
        -->
    </style>
    <script language="javascript">
        function checkSingle() {
            let oForm = document.forms["myForm1"];
            let oSelectBox = oForm.constellation;
            let iChoice = oSelectBox.selectedIndex;
            alert("aaa" + oSelectBox.options[iChoice].text);
        }
    </script>
</head>
<body>
    <form method="post" name="myForm1">
        <label for="constellation">本月幸运星座</label>
        <p>
            <select id="constellation" name="constellation">
                <option value="Aries" selected="selected">白羊座</option>
                <option value="Taurus">金牛座</option>
                <option value="Gemini">双子座</option>
                <option value="Cancer">巨蟹座</option>
                <option value="Leo">狮子座</option>
                <option value="Virgo">处女座</option>
                <option value="Libra">天秤座</option>
                <option value="Scorpio">天蝎座</option>
                <option value="Sagittarius">射手座</option>
                <option value="Capricorn">摩羯座</option>
                <option value="Aquarius">水瓶座</option>
                <option value="Pisces">双鱼座</option>
            </select>
        </p>
        <input type="button" onclick="checkSingle()" value="查看结果" />
    </form>
</body>
</html>
